#ifndef DBCONNECTION_H
#define DBCONNECTION_H
#include <string>
#include <client/dbclient.h>
using namespace mongo;
using namespace std;

template<typename ConnectType,typename ResultType>
class DBConnection
{
public:
    DBConnection(ConnectType connect,string connectName)
    {
        this->connection=connect;
        this->connectName=connectName;
    }
    ~DBConnection()
    {}
    int connect(string username,string password,string connectParam);
    ConnectType getRawConnection();
    ResultType runCommand(string sql);
    //ConnectType* operator ();
public:
    ConnectType connection;
    string connectName;
};

#include "dbconnection.cpp"
#endif // DBCONNECTION_H
